package com.neu.service.impl;

import java.util.ArrayList;

import com.neu.dao.IpatientDao;
import com.neu.dao.impl.PatientDao;
import com.neu.pojo.Patient;
import com.neu.service.IpatientService;

public class PatientService implements IpatientService {
	private IpatientDao patientDao = PatientDao.getInstance();
	//单例模式
	private static PatientService patientService = new PatientService();
	private PatientService() {}
	public static PatientService getInstance() {
		return patientService;
	}
	
	public boolean add(Patient p) {
		return this.patientDao.add(p);
	}
	
	//getAll
	@Override
	public ArrayList<Patient> list(){
		return patientDao.list();
	}
	
	//删除
	@Override
	public boolean delete(Patient p) {
		return patientDao.delete(p);
	}
	
	public Patient search(Patient patient) {
		return this.patientDao.search(patient);
	}
	
}
